#ifndef DETECTOR_H
#define DETECTOR_H

#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>

#include <QMutex>

class Detector
{
public:
    Detector();
    Detector(const std::string& filename);

    void addCascade(const std::string&);
    void setScale(double);
	double getScale();
    void detect(const cv::Mat&,std::vector<cv::Rect>&);

	static const int DEFAULT_SCALE = 5;
	static const int MAX_SCALE = 10;
	static const int MIN_SCALE = 1;

private:
    std::vector<cv::CascadeClassifier> cascades;
    double scale;
	QMutex mutex;
};

#endif // DETECTOR_H
